import request from '@/utils/request'

export function saveChatHistory(data) {
    return request({
        url: '/ai/chat/save',
        method: 'post',
        data: data
    })
}

export function updateChatHistory(data) {
    return request({
        url: '/ai/chat/update',
        method: 'post',
        data: data
    })
}

export function updateChatHistoryMessages(data) {
    return request({
        url: '/ai/chat/update/messages',
        method: 'post',
        data: data
    })
}

export function deleteChatHistory(chatHistoryId) {
    return request({
        url: '/ai/chat/delete?chatHistoryId=' + chatHistoryId,
        method: 'delete',
    })
}

export function getChatHistoryByUserId(userId) {
    return request({
        url: '/ai/chat/get/history?userId=' + userId,
        method: 'get',
    })
}


